<%@ page import="java.util.Date"%>
<%@ page import="message.FileWasChanged"%>
<%@ page import="serverManger.Server"%>
<%@ page import="java.io.FileInputStream" %>
<%@ page import="java.io.BufferedInputStream"  %>
<%@ page import="java.io.File"  %>
<%@ page import="java.io.IOException" %>
<%@ page import="java.util.Set" %>
<%@ page import="serverDB.*" %>
<%@ page import="serverManger.Server" %>
<%@ page import="java.util.List" %>

<%	
	ConnectToDataBase connectToDataBase = ConnectToDataBase.getInst();
	Client client = connectToDataBase.regetClient((Client)session.getAttribute("client"));
	Set<Box> boxes = client.getBoxes();
	String boxName = request.getParameter("boxName");
	Box box = connectToDataBase.getBox(client,boxName);
	if(box!=null){
		session.setAttribute("error","This box is allready exist!");
		response.sendRedirect("newBox.jsp");
	}
	Server server = Server.getServerInst();
	server.newBox(boxName,client,null);
	response.sendRedirect("logedIn2.jsp");
   
%>